package com.crfchina.feign.eurekafegin.web;

import com.crfchina.feign.eurekafegin.pojo.User;
import com.crfchina.feign.eurekafegin.service.ComputeClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ConsumerController {

    @Autowired
    ComputeClient computeClient;
    @RequestMapping(value = "/add",method = RequestMethod.GET)
    public Integer add(){
          return      computeClient.add(20,30);
    }



    @RequestMapping(value = "/user",method = RequestMethod.GET)
    public String user(@RequestParam(value = "name") String name,@RequestParam(value = "age") String age){
        User user = new User();
        user.setAge(age);
        user.setName(name);
        return      computeClient.user(user);
    }



}
